# coding: utf-8
from PySide6.QtCore import QSize, Qt
from PySide6.QtWidgets import QWidget, QVBoxLayout
from qfluentwidgets import BodyLabel, IconWidget, setFont
from common import SingleIcon


class NoDataCard(QWidget):
    def __init__(self, parent=None):
        super().__init__(parent)
        self.verticalLayout = QVBoxLayout(self)
        self.iconWidget = IconWidget(SingleIcon.NO_DATA, self)
        self.bodyLabel = BodyLabel(self.tr("暂无数据"), self)

        self.iconWidget.setFixedSize(120, 120)
        setFont(self.bodyLabel, 20)
        self.verticalLayout.addWidget(self.iconWidget)
        self.verticalLayout.addWidget(self.bodyLabel, 1, Qt.AlignmentFlag.AlignCenter)
        self.setFixedSize(QSize(142, 175))


if __name__ == '__main__':
    import sys
    from PySide6.QtWidgets import QApplication

    app = QApplication(sys.argv)
    card = NoDataCard()
    card.show()
    sys.exit(app.exec())
